﻿using System;

namespace PropertyExpression.ControllableQuery
{
    public interface IParam<in T>
    {
        string Name { set; }

        Func<T> ValueFunc { set; }

        T Value { set; }

        string ToSql();
    }

    public static class ParamExtensions
    {
        public static string ToSql<T>(this IParam<T> it, string name)
        {
            it.Name = name;
            return it.ToSql();
        }
    }
}